#ifndef YANSE_H
#define YANSE_H
#include <sys/socket.h>
#include <arpa/inet.h>
#include <string.h>
#include <string>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <stdlib.h>
#define AUTH_REQ		0x000001
#define AUTH_RESP		0x900001
#define QUIT_REQ		0x000003
#define QUIT_RESP		0x900003
#define HEART_REQ		0x000005
#define HEART_RESP		0x900005
#define CONTROL_REQ		0x000012
#define CONTROL_RESP	0x900012
#define POST_NODE_REQ   0x000007
#define POST_NODE_RESP  0x900007
#define POST_NODE_DATA_REQ  0x00000b
#define POST_NODE_DATA_RESP 0x90000b
using namespace std;

class yanse
{
public:
    // yanse();
    yanse(int port);
    bool udp_send(char* ip,int port,char *buf);
    bool sockbind();
    bool recive();
private:
    int clt_port;
    struct sockaddr_in client_addr;
    int sock;
};

#endif // YANSE_H
